package v1

import (
	"devops-super/api"
	"devops-super/internal/model/entity"
	"devops-super/internal/model/mymodel"
	"github.com/gogf/gf/v2/frame/g"
)

type LoginGetPageLstReq struct {
	g.Meta `method:"get" path:"/login-log/page-list" summary:"分页获取登录日志列表" tags:"登录日志"`
	*api.PageLstReq
	UserName  string   `json:"userName" description:"用户名"`
	IpAddr    string   `json:"ipAddr" description:"IP地址"`
	TimeRange []string `json:"timeRange"` // 时间范围[开始,结束]
}

type LoginGetPageLstRes struct {
	Total int                         `json:"total"`
	List  []*mymodel.LoginLogResponse `json:"list"`
}

type LoginGetOneReq struct {
	g.Meta `method:"get" path:"/login-log/{infoId}" summary:"获取登录日志详情" tags:"登录日志"`
	InfoId uint64 `v:"min:1" path:"infoId"`
}

type LoginGetOneRes struct {
	Info *entity.SysLoginLog `json:"info"`
}

type LoginAddReq struct {
	g.Meta `method:"post" path:"/login-log" summary:"新增登录日志" tags:"登录日志"`
	*mymodel.LoginLog
}

type LoginAddRes struct {
	InfoId uint64 `json:"infoId"`
}

type LoginDelReq struct {
	g.Meta `method:"delete" path:"/login-log/{infoId}" summary:"删除登录日志" tags:"登录日志"`
	InfoId uint64 `v:"min:1" path:"infoId"`
}

type LoginDelRes struct {
	Rows int64 `json:"rows"`
}

type LoginBatchDelReq struct {
	g.Meta  `method:"delete" path:"/login-log/batch-del" summary:"批量删除登录日志" tags:"登录日志"`
	InfoIds []uint64 `v:"required" json:"infoIds"`
}

type LoginBatchDelRes struct {
	Rows int64 `json:"rows"`
}
